﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using IDE;

namespace wpf_buildtool
{
    public class Plugin : IDE.IPlugin
    {

        public string Name => "buildtool";
        public static IDE.I_IDE _IDE
        {
            get;
            private set;
        }

        public IDE.I_IDE IDE
        {
            get
            {
                return _IDE;
            }
            set
            {
                if (_IDE == null)
                    _IDE = value;
            }
        }

        public PanelInfo[] panels =>
        new PanelInfo[]{
            new PanelInfo(){ type="proj", title="project", description="", defaultWidth=400,defaultHeight=1000}
        };

        public FileTypeDesc[] filetypes => new FileTypeDesc[]
            {

            new FileTypeDesc() { extname = ".asm", description = "asm file", icon = null}
            };


        public ToolBar[] toolbars => new ToolBar[]
        {
             new wpf_buildtool.Toolbar_Build()
        };

        public MenuOption[] MenuItem => null;

        public void CreateEmptyFile(string type, string filename)
        {
            throw new NotImplementedException();
        }
        public IDocument OpenFile(string extname, string filename, bool writeable)
        {
            if (extname == ".asm")
            {
                var ui = new file_nesasm3();
                var doc = ui.OpenFile(filename, writeable);
                return doc;
            }
            throw new NotImplementedException();

        }


        public UIElement CreatePanelUI(string type)
        {
            if (type == "proj")
            {
                return new panel_projfolder();
            }
            throw new NotImplementedException();
        }

        public void OnMenuClick(string path)
        {
            throw new NotImplementedException();
        }


    }


}
